//
//  WmcCPFeedbackItemView.swift
//  YPWatermarkCamera
//
//  Created by Json on 2023/8/1.
//

import UIKit

class WmcCPFeedbackItemView: WmcBaseView {

    private lazy var iconView: UIImageView = {
        let imgView = UIImageView()
        return imgView
    }()
    private lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.font = 15.wmc_scaleFont()
        label.textColor = UIColor.wmc_black65
        return label
    }()
    
    var item: WmcFeedbackItem = .init() {
        didSet {
            titleLabel.text = item.label
            iconView.image = item.isChecked ? "icon_check_selected_24".wmc_image : "icon_check_normal_24".wmc_image
        }
    }
    
    
    override func makeUI() {
        super.makeUI()
        let iconWH = 24.0.wmc_autoHor
        addSubview(iconView)
        iconView.snp.makeConstraints { make in
            make.width.height.equalTo(iconWH)
            make.left.equalToSuperview()
            make.centerY.equalToSuperview()
        }
        addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(iconView.snp.right).offset(12.0.wmc_autoHor)
            make.centerY.equalToSuperview()
            make.right.equalToSuperview()
        }
    }

}
